let a = [2,4,6,8,10];

let result = a.reduce((r,v,i,arr) => {
    console.log(`i = ${i},v = ${v},r = ${r}`);
    return r + v;
})
console.log("Result = ",result);